//
//  WanShanQianYueViewController.m
//  跨界收
//
//  Created by Allen on 2018/11/12.
//  Copyright © 2018年 gztx. All rights reserved.
//

#import "WanShanQianYueViewController.h"
#import "MessageHeaderView.h"
#import "JiBenXinXiViewController.h"
#import "RegisterMessageViewController.h"
#import "SettleMessageViewController.h"
#import "PhotoMessageViewController.h"

@interface WanShanQianYueViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableview;
@property (nonatomic, strong) NSArray *msgArray;


@end

@implementation WanShanQianYueViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"完善签约管理";
    self.tableview.delegate = self;
    self.tableview.dataSource = self;
    self.tableview.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    _msgArray = @[@"基本信息",@"注册信息",@"结算信息",@"照片资料"];
    MessageHeaderView *headerView = [MessageHeaderView shareInstance];
    headerView.categoryLabel.text = self.category;
    UIView *header = [[UIView alloc] init];
    header.backgroundColor = [UIColor whiteColor];
    headerView.frame = CGRectMake(0, 10, SCREEN_WIDTH, 60);
    header.frame = CGRectMake(0, 0, SCREEN_WIDTH, 80);
    [header addSubview:headerView];
    self.tableview.tableHeaderView = header;
    
    // Do any additional setup after loading the view from its nib.
}
#pragma mark -- UITableViewDelegate/DataSource --
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 10.0;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return _msgArray.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 55;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *identifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier];
    }
//    cell.imageView.image = [UIImage imageNamed:@"tuoyuan_gray"];
    cell.imageView.image = [UIImage imageNamed:@"tuoyuan_gou"];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.textLabel.font = [UIFont systemFontOfSize:13];
    cell.textLabel.text = [NSString stringWithFormat:@"第%ld步", (long)indexPath.section+1];
    cell.detailTextLabel.font = [UIFont systemFontOfSize:16];
    cell.detailTextLabel.text = _msgArray[indexPath.section];
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    switch (indexPath.section) {
        case 0:
        {
            JiBenXinXiViewController *jxVC = [[JiBenXinXiViewController alloc] initWithNibName:@"JiBenXinXiViewController" bundle:nil];
            [self.navigationController pushViewController:jxVC animated:YES];
        }
            break;
        case 1:
        {
            RegisterMessageViewController *regiterVC = [[RegisterMessageViewController alloc]initWithNibName:@"RegisterMessageViewController" bundle:nil];
            [self.navigationController pushViewController:regiterVC animated:YES];
        }
            break;
        case 2:
        {
            SettleMessageViewController *settleVC = [[SettleMessageViewController alloc] initWithNibName:@"SettleMessageViewController" bundle:nil];
            [self.navigationController pushViewController:settleVC animated:YES];
        }
            break;
        case 3:
        {
            PhotoMessageViewController *photoVC = [[PhotoMessageViewController alloc] initWithNibName:@"PhotoMessageViewController" bundle:nil];
            [self.navigationController pushViewController:photoVC animated:YES];
        }
            break;
            
        default:
            break;
    }
   
}
@end
